MaterialComponentsShadowHelper
Deprecated
The inflation subpackage is being removed entirely.
A specialized AppCompatViewInflater that hooks into the layout inflation pipeline to process the library's custom attributes.
This is not meant to be used directly, but it must be public so that the androidx appcompat framework has access. It can be applied either through resources with an XML theme attribute, or by doing the equivalent thing in code with a helper function.
For example, using an XML theme:
<style name="Theme.YourApp" parent="Theme.MaterialComponents…">
…
<!-- Or use the fully qualified class name in place of the @string. -->
<item name="viewInflaterClass">
@string/material_components_shadow_helper
</item>
</style>Content copied to clipboard
Or, using a helper function, which simply adds the attribute setting to the current theme programmatically:
class YourActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
attachMaterialComponentsShadowHelper()
super.onCreate(savedInstanceState)
…
}
}Content copied to clipboard